home *** CD-ROM | disk | FTP | other *** search
/ Sound Fx / Sound Fx.iso / Software / ZIPED / DWSTK.EXE / DWDSP.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-10  |  2.5 KB  |  86 lines

  1. /*****************************************************************************
  2. File:          dwdsp.h
  3. Version:     2.22
  4. Tab stops: every 2 columns
  5. Project:     DiamondWare's DSP add-on for its STK product
  6. Copyright: 1995 DiamondWare, Ltd.  All rights reserved.
  7. Written:     by Keith Weiner & Erik Lorenzen
  8. Purpose:     Contains declarations for DSP functions
  9. History:     see dwdsp.c
  10. *****************************************************************************/
  11.  
  12.  
  13.  
  14. #ifndef dwdsp_INCLUDE
  15.  
  16.     #define dwdsp_INCLUDE
  17.  
  18.  
  19.  
  20.     #include "dws.h"
  21.  
  22.  
  23.  
  24.     #define dwdsp_IDENTITY    0x100  /* for no change in volume level */
  25.  
  26.  
  27.     /*
  28.      . This is the complete list of possible return values for dwdsp_ErrNo.
  29.      . An error may be flagged by any dwdsp_ function.    Call dwdsp_ErrNo
  30.      . whenever the return value of a dwdsp_ function is 0 (error).
  31.     */
  32.     #define dwdsp_EZERO     0     /* no error */
  33.  
  34.     /* The following 2 errors may be triggered by any dwdsp_ function */
  35.     #define dwdsp_NOTADWD 1     /* you passed a ptr that doesn't belong to a DWD */
  36.     #define dwdsp_NULLPTR 2     /* you passed a NULL ptr */
  37.  
  38.     /* The following 2 errors may be triggered by dwdsp_ChngLen */
  39.     #define dwdsp_BADLEN    3     /* the length is too short to be useable */
  40.     #define dwdsp_SAMEPTR 4     /* this function does not support operation on */
  41.                                                         /* the source buffer */
  42.  
  43.  
  44.     #ifdef __cplusplus
  45.         extern "C" {
  46.     #endif
  47.  
  48.     /* dwdsp_ErrNo() returns the number of the last error which occured. */
  49.     word dwdsp_ErrNo(void);
  50.  
  51.  
  52.     /*
  53.      . This function will copy the source DWD to the destination buffer, and
  54.      . change the volume.  You may pass it srcdwd == desdwd), to change the
  55.      . the volume in-place.
  56.      .
  57.      . volume is specified as a factor of dwdsp_IDENTITY; 0x100 will keep
  58.      . the level unchanged, 0x80 will be half as loud, and 0x200 will be
  59.      . twice as loud.  Although each sample is clipped to the limited
  60.      . dynamic range, excessive clipping causes noise.    Experiment with
  61.      . this function to find acceptable limits for volume; it will depend
  62.      . heavily on the source sound effect.
  63.     */
  64.     word dwdsp_ChngVol(byte *desdwd, byte *srcdwd, word volume);
  65.  
  66.  
  67.     /*
  68.      . This function changes the length of a DWD, and thereby its pitch.
  69.      .
  70.      . newlen specifies the length of the destination DWD (your buffer
  71.      . must be at least newlen big!)
  72.      .
  73.      . NB: Unlike with volume, length cannot be changed in place!
  74.     */
  75.     word dwdsp_ChngLen(byte *desdwd, byte *srcdwd, dword newlen);
  76.  
  77.  
  78.  
  79.     #ifdef __cplusplus
  80.         }
  81.     #endif
  82.  
  83.  
  84.  
  85. #endif
  86.